package com.zhongyu.comm.api;

import com.zhongyu.comm.pojo.Task;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.List;

public interface TaskApi {

    @RequestMapping("/taskApi/findByStatusAndOvertimeBefore")
    List<Task> findByStatusAndOvertimeBefore(@RequestParam("status") int status,@RequestParam("overtimeBefore") LocalDateTime overtimeBefore,@RequestParam("limit") int limit);

    @RequestMapping("/taskApi/updateTaskVersion")
   public  int updateTaskVersion(@RequestParam("taskId") String taskId,@RequestParam("taskVersion") Integer taskVersion);


    @RequestMapping("/taskApi/updateStatus")
    public int updateStatus(@RequestParam("taskId") String taskId,@RequestParam("status") Integer status,@RequestParam("updateTime") LocalDateTime updateTime);

    @RequestMapping("/taskApi/updateTryCountByTaskId")
    public int updateTryCountByTaskId(@RequestParam("taskId")String taskId,@RequestParam("updateTime") LocalDateTime updateTime);

    @RequestMapping("/taskApi/updateErrormsg")
     public int updateErrormsg(@RequestParam("taskId")String taskId,@RequestParam("errormsg")String errormsg,@RequestParam("updateTime") LocalDateTime updateTime);

}
